From f6ce67d7053d00e11e0eda653e2f39d7955fb3b4 Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Sun, 30 May 2021 20:39:55 +0200 Subject: [PATCH] Get which-key--buffer's window from any frame Previously we assumed the buffer was being displayed in a window of the current frame, which isn't the case if e.g. a child frame is being used. We also cannot assume that the third-party code that sets up such a child frame also deletes it. `which-key-posframe' for example merely hides it. --- which-key.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/which-key.el b/which-key.el index 3f5f8097cd1..74accfa3383 100644 --- a/which-key.el +++ b/which-key.el @@ -1175,7 +1175,10 @@ popup)." (defun which-key--popup-showing-p () (and (bufferp which-key--buffer) - (window-live-p (get-buffer-window which-key--buffer)))) + (or (window-live-p (get-buffer-window which-key--buffer)) + (let ((window (get-buffer-window which-key--buffer t))) + (and (window-live-p window) + (frame-visible-p (window-frame window))))))) (defun which-key--show-popup (act-popup-dim) "Show the which-key buffer. -- 2.30.2